
{% extends 'blog/i/base.html' %}
{% load filter_tool %}


{% block menu %}                   
    {% include 'blog/i/blog_menu.html' %}
{% endblock %}



{% block content %}
			<div class="blog" >
                    <div class="list" >
                        <ul>
                            {% for article in articles %}
                               <li class="item" >

                                <div class="title" >
                                    <a href="{{ current_user_url }}/blog/{{ article.id }}" >{{ article.title }}</a> 
                                </div>

                            <div class="au" >
                            <a href="/people/{{ current_user_url }}">{{ current_user.nickname }}</a>
                                 <span class="time" >
                                    {{ article.create_time|date:'Y-m-d H:i' }}
                                </span>
                            </div>

                                 {% autoescape off %}

                                <div class="content" >
                                    {{ article.content|cutwords_html:150 }}
                                </div>

                                <a class="viewall" href="{{ current_user_url }}/blog/{{ article.id }}">查看全文</a>
                                
                                {% endautoescape%}

                                <div class="edit" >
                                    <span>
                                        <a href="/blog/edit/{{ article.id }}" >编辑</a>
                                        <a href="#" >评论</a>
                                    </span>
                                </div>

                            </li> 
                                
                            {% endfor %}
                        </ul>
                        
                        <div class="page" >

                          {% if page.prev_page_number and not less_than_certain_size %}
                             <a href="{{ user_url }}/blog?page={{ page.prev_page_number }}" class="prev"> <<-上一页</a>
                          {% endif %}

                         {% for key,value in pages %}

                            {% ifequal page.page_number key %}

                              <a href="{{ user_url }}/blog?page={{ key }}" class="current_page" >  {{ value.page_number }}  </a>

                            {% else %}

                                <a href="{{ user_url }}/blog?page={{ key }}" >  {{ value.page_number }}  </a>

                            {% endifequal %}

                        {% endfor %}

                           
                            
                        {% if page.has_next  and not less_than_certain_size %}
                            <a href="{{ user_url }}/blog?page={{ page.next_page_number }}" class="next" >下一页->></a>
                        {% endif %}
                      
                        
                        </div>

                    </div>

                </div>
{% endblock %}



